package com.zr.java8.pattern.chain.handler;

import com.zr.java8.pattern.chain.Approver;
import com.zr.java8.pattern.chain.LeaveApplication;

/**
 * 具体处理器2：经理
 */
public class ManagerHandler extends Approver {
    @Override
    public void processLeaveApplication(LeaveApplication application) {
        if (application.getDays() <= 5) {
            System.out.println("Manager approved leave for " + application.getDays() + " days");
        } else if (successor != null) {
            successor.processLeaveApplication(application);
        }
    }
}
